import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { Response } from './common/response';
// import * as session from 'express-session';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  // 全局路由前缀
  app.setGlobalPrefix('/api');

  app.useGlobalInterceptors(new Response());

  // app.use(
  //   session({
  //     secret: 'xiao',
  //     name: 'session.test',
  //     rolling: true,
  //     cookie: { maxAge: null },
  //   }),
  // );

  await app.listen(4123);
}
bootstrap();
